UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BPUoiCyCKDvabdijZuhcwTc6xKQ3LYYJbW8aG99yJpo='
WHERE
key_id = '3826ae1a8a3ba9c660bc3e7c953482517418297631da46923c0cdba06db08b4a'
AND (
token = 'BPUoiCyCKDvabdijZuhcwTc6xKQ3LYYJbW8aG99yJpo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)