UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LydM4rNRM7gUNIWYUGL79OYSA+14V+3RRCwc5adAChA='
WHERE
key_id = '03709165c76ccec0766a9a58ee2117faf6199f212578ae63a05f28d05df798c0'
AND (
token = 'LydM4rNRM7gUNIWYUGL79OYSA+14V+3RRCwc5adAChA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)