UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'af52rDirjUj4aXetK6LS6jcmxW+lXOfiT6r/DQyvzec=' 
WHERE 
  key_id = '0e542a4815d77d5f85bed8cdce89eadc46432caa1c22a92199c0a9d8fab97fcf' 
  AND (
    token = 'af52rDirjUj4aXetK6LS6jcmxW+lXOfiT6r/DQyvzec=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025