UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ImeniiPJHPGRraJaiOpJ0waBTmJf+uLc3fN9fpR8twQ=' 
WHERE 
  key_id = '7f85a8c6d38032f163895553959dcb80ea6b4841cc7d4a5df3ce8b57f79881ca' 
  AND (
    token = 'ImeniiPJHPGRraJaiOpJ0waBTmJf+uLc3fN9fpR8twQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039