UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xK/AGNtE7W0b498PWykrg280OlUiPobvgD//2dAlfrw=' 
WHERE 
  key_id = '088b4d7b030911bf1d972e5e2150a28ac7e7ab46a8a53ac04a75b51a6ebf96c1' 
  AND (
    token = 'xK/AGNtE7W0b498PWykrg280OlUiPobvgD//2dAlfrw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028