UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iFxnViW5B/yQboKXZhlIbOowqUz6mqnjVVpHkwjdBRk=' 
WHERE 
  key_id = '397ec127a22fb4d9595d2dfdf85075a66bd69409ddbb2e35b331bb4f3111fad8' 
  AND (
    token = 'iFxnViW5B/yQboKXZhlIbOowqUz6mqnjVVpHkwjdBRk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033