UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TKMrKXUGzq54E/k0ip9Z41g8b5Wg4dnY/g6ilhsfZXE='
WHERE
key_id = 'f9e7a58a06df8fc864a9c4e30bf8d3564c6f2a1bba0a66e0456617aa444858ce'
AND (
token = 'TKMrKXUGzq54E/k0ip9Z41g8b5Wg4dnY/g6ilhsfZXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)