UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jto3yL8+3RNZTiOekkyykADQJdFsoUpT133ohwRIg3E=' 
WHERE 
  key_id = '0a34a80e0ef2730d9a2f620dc2d3b7f25349a12768f6633144b7749e3e50eac6' 
  AND (
    token = 'jto3yL8+3RNZTiOekkyykADQJdFsoUpT133ohwRIg3E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028