UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WPEtxgZ9RupKDBtm359tcufItnrlnbsXCpJ6Omfa0sU=' 
WHERE 
  key_id = '03e8fa69928b1357f213765a045a771dea6b4fb30dc2cb3971e3411955564e7c' 
  AND (
    token = 'WPEtxgZ9RupKDBtm359tcufItnrlnbsXCpJ6Omfa0sU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040