UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HPjMSuW5cLf/h0qHscdYPi6tZ9uxuojKp3RjNpCqhm4=' 
WHERE 
  key_id = 'c774bfca4dc42971dc7a001db0a77e19f6426f9f98ccac9b0ecd5a07d86bd316' 
  AND (
    token = 'HPjMSuW5cLf/h0qHscdYPi6tZ9uxuojKp3RjNpCqhm4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026