UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HcndFC5b65g+i5UvpVEhZ1s42IAUGHkIdB7A+Gb7PtY=' 
WHERE 
  key_id = '905a4476dd1764a88a110f448ce94f9af13a20c42efce5be216e87a097e6b5dc' 
  AND (
    token = 'HcndFC5b65g+i5UvpVEhZ1s42IAUGHkIdB7A+Gb7PtY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028