UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sL7x0LzH6hYoshvduu1eK6XXSV1UTSNPJXNcYIxtaBo='
WHERE
key_id = '912ada608a4c25ff8050e9253082d7359f0890a4f247ee47f3b10af199ded841'
AND (
token = 'sL7x0LzH6hYoshvduu1eK6XXSV1UTSNPJXNcYIxtaBo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)