UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'd2l+yU3ppb3+2+cPgNWCSDTsQQSKlalmKpW3QnNj214=' 
WHERE 
  key_id = 'a061badf10b4c56c3dcfbfe5e8e89f58dee781fbf85cc8508d4dc5866befbb74' 
  AND (
    token = 'd2l+yU3ppb3+2+cPgNWCSDTsQQSKlalmKpW3QnNj214=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021