UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i4Y11UixhXUQKIEGPht9HE5mLoPl6cv4kwO6PtU/pnE=' 
WHERE 
  key_id = '00cef3de58eebf784207cb3e178956242b4b2a0e08dfe9eabef457c0b4b327d3' 
  AND (
    token = 'i4Y11UixhXUQKIEGPht9HE5mLoPl6cv4kwO6PtU/pnE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059