UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jXntDayYzFJnsMiGZ/p/5ymM54Cf8AuPDw57H7/brl0='
WHERE
key_id = 'c6dbd9d5f20cfc7a6369ebe105e3cd8f0827efd89c0f7a62f8133f131538ca91'
AND (
token = 'jXntDayYzFJnsMiGZ/p/5ymM54Cf8AuPDw57H7/brl0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)