UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TsOS+JD3kn7m3MmORm6xFK7+WjDHeuTgBowQw0pRt58='
WHERE
key_id = '4a0f09d8e157cf612b24c91ef4d73a921a3caa2d085dbd5f2d730de9ab9292d8'
AND (
token = 'TsOS+JD3kn7m3MmORm6xFK7+WjDHeuTgBowQw0pRt58='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)