UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+32QDhczKIMR2DdGQ7zMa3xFcPSk6yWWkry4oAH7hI8='
WHERE
key_id = '5e424e3e829bf275622a20c0be6c23f95135040f559174d096ab1e2cfdf679eb'
AND (
token = '+32QDhczKIMR2DdGQ7zMa3xFcPSk6yWWkry4oAH7hI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)