UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Ru9aqZwr0QpOXQkzC5zVj+IS+EleBQjr7Sfu7Gx9gQ=' 
WHERE 
  key_id = '47844b8e829cbf23b2e786c81b3cf9621f5ebed08eeb2e0336545117cc21efa2' 
  AND (
    token = '0Ru9aqZwr0QpOXQkzC5zVj+IS+EleBQjr7Sfu7Gx9gQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034