UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Do4G3Qb2xWSZExmrugpeYHngPPzD96EUkxLDBzolPU='
WHERE
key_id = '9a4f547d0e7da521d5d1a93c12526ebee730551ce44dc997087288af331467c0'
AND (
token = '1Do4G3Qb2xWSZExmrugpeYHngPPzD96EUkxLDBzolPU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)