UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TL1ErmDGkMY3nh9KoifuBfLt2NLSBvnqzVqe1C5xwzc='
WHERE
key_id = '0c34c66f65c6e3830728c954da6dbfeeec35bef96b4337b529dc6e9c2d8527d2'
AND (
token = 'TL1ErmDGkMY3nh9KoifuBfLt2NLSBvnqzVqe1C5xwzc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)