UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dXfZZwb4NQRSWYymWpiVL69woCECoWiBiJ5Unm4K5LA='
WHERE
key_id = 'cb2f350b95d95ff098d39338b2352881d453b8ecbbebc9e4637c6a1e92c6bf9e'
AND (
token = 'dXfZZwb4NQRSWYymWpiVL69woCECoWiBiJ5Unm4K5LA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)