UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UOOUQdHfMtHyboUg69npuFpvvEJIas8GtzBmAJbqqco='
WHERE
key_id = '700baac39141870f9f02c8df367bf6e8384783b4194dc4a500f0407c272614bc'
AND (
token = 'UOOUQdHfMtHyboUg69npuFpvvEJIas8GtzBmAJbqqco='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)