UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CTmmFssbyOiYwavooNo3TDclTWRD2FsdXT6NFZRBYwM='
WHERE
key_id = '7688259c6f5ccced94d06f94fae6fd91911f9258982046c64f2f43fadcfdd6ca'
AND (
token = 'CTmmFssbyOiYwavooNo3TDclTWRD2FsdXT6NFZRBYwM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)