UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B2zyG2dLLG6SkXj+/tdmPkhVPn6nUk61GfGzJHLQ3so='
WHERE
key_id = 'acebe8508b1b5b8eb8bb1947404a30180716742b769feb82672244fa348bd2a9'
AND (
token = 'B2zyG2dLLG6SkXj+/tdmPkhVPn6nUk61GfGzJHLQ3so='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)