UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f5Gm0b6UqdmFs224FLLkf5cKcND7emnCjJls8Ms2Fcw='
WHERE
key_id = '2af5a5cbca0e06297cdfe7ab8c68a0bfe7e8a43ab00d71045a0449f8bb7f24d6'
AND (
token = 'f5Gm0b6UqdmFs224FLLkf5cKcND7emnCjJls8Ms2Fcw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)