UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O+I7Ys8D6WSwd4MV20/j6VNnckUc2iMqfqrSO43jlao='
WHERE
key_id = '7039fc9bf5e5dd298b11cc09a0395b58c822e9d8fa6bd8f7f1008cb53282342d'
AND (
token = 'O+I7Ys8D6WSwd4MV20/j6VNnckUc2iMqfqrSO43jlao='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)