UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rJNyUlr5JR84Tw0a3wAPVI6f67QVbXje/PkvZTixa6E=' 
WHERE 
  key_id = 'b3d4732fdf9e85a8d3255a87cc815d2e74ebf295f2680604a7478c757ff26f58' 
  AND (
    token = 'rJNyUlr5JR84Tw0a3wAPVI6f67QVbXje/PkvZTixa6E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028