UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DIjbg//hbrz9DfZH4gUYIWPS6pNNcaDJ9hq3ajpxoQo='
WHERE
key_id = 'f3f19027883d5391d5826ec0ae2b2804526cca205f4af9427cb9d309729f30c8'
AND (
token = 'DIjbg//hbrz9DfZH4gUYIWPS6pNNcaDJ9hq3ajpxoQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)