UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WiGbdGK9aObjt54xItmt2NG0BB/vlWpcPdeyEWBez30='
WHERE
key_id = 'c5e0e202bc4da70b3148378cfff7b88ea5427f17b9a23464fe9a0a3c781e963a'
AND (
token = 'WiGbdGK9aObjt54xItmt2NG0BB/vlWpcPdeyEWBez30='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)