UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cRmNG3IqldzqS31iysdIQl/iysfUQkUr2rEexUU/lT8='
WHERE
key_id = 'b9dd21e8f26807a80c05348cef7d2ad8fde19da92f5cdd2c4f48f789869e2ce0'
AND (
token = 'cRmNG3IqldzqS31iysdIQl/iysfUQkUr2rEexUU/lT8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)