UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B1JNK5/j+G/MYkLVL/TClMyrXwsnxoCDoNBGvK7dHME='
WHERE
key_id = 'd1c249af5502b0d625c6bfd2b6829f30c7fa89c9d264ea6ae66c37f979c191d7'
AND (
token = 'B1JNK5/j+G/MYkLVL/TClMyrXwsnxoCDoNBGvK7dHME='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)