UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rExa2kfBm20XQNhkaV2T61AnA/ZFBa/TEbMUmwD+Yig='
WHERE
key_id = '8fcf82de6a88416a53c62e98f17246da0a309ce9ecab0193c5743680c579e2ab'
AND (
token = 'rExa2kfBm20XQNhkaV2T61AnA/ZFBa/TEbMUmwD+Yig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)