UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7fO5G5cO0FRNh6c6OZrB1rgoqN3rJZcC+mgIZRMHIZ8='
WHERE
key_id = '443c3cd9e813fea8d28220e5985d577611d42762b783d153604a328fa96a2c33'
AND (
token = '7fO5G5cO0FRNh6c6OZrB1rgoqN3rJZcC+mgIZRMHIZ8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)