UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7ECzf0+WeTBU7pq5MtMlAGtnLztr6D2nvA/YEcPuFPE='
WHERE
key_id = '9b4a15a0451ae534c513c449b399ebcc7185bf4f4f4591962fcff30823c62a9e'
AND (
token = '7ECzf0+WeTBU7pq5MtMlAGtnLztr6D2nvA/YEcPuFPE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)