UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wsv4VrnYm66uBPJlsNevII9g3mv0zZASxPaHCQ1p4WE=' 
WHERE 
  key_id = '60d5e1906297be16888b64692f395ce39a30c3fe7774fc210820c51c658a0dd6' 
  AND (
    token = 'Wsv4VrnYm66uBPJlsNevII9g3mv0zZASxPaHCQ1p4WE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049