UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7smJxqGTL/Y8S0C6jAdAIIOnBv+OyoAwmD4kKF3zM0Q=' 
WHERE 
  key_id = '6c7e72e61db8c05f7529f093ff77205ca2f10a2db50221dc48e7ebf56f275053' 
  AND (
    token = '7smJxqGTL/Y8S0C6jAdAIIOnBv+OyoAwmD4kKF3zM0Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028