UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NePAMwVClVMarHyvq/5wmWCJSEFhBnp+vv79Xc0fwfw=' 
WHERE 
  key_id = '971b846da5fe69ddbd8ad7241cb2cb657f5441de9ce81c4683a9a0445ee8945e' 
  AND (
    token = 'NePAMwVClVMarHyvq/5wmWCJSEFhBnp+vv79Xc0fwfw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039